package com.solution.delegate;

import java.util.List;

import com.solution.exception.DelegateException;
import com.solution.exception.ServiceBeanException;
import com.solution.exception.ServiceLocatorException;
import com.solution.model.SchdJobAssociations;
import com.solution.service.SchdJobAssociationsService;
import com.solution.util.ServiceLocator;

public class SchdJobAssociationsServiceDelegate implements
		SchdJobAssociationsService {

	private SchdJobAssociationsService schdJobAssociationsService;

	public SchdJobAssociationsServiceDelegate() throws DelegateException {
		try {
			schdJobAssociationsService = (SchdJobAssociationsService) ServiceLocator
					.getInstance().getRemoteService(
							"SchdJobAssociationsService");
		} catch (ServiceLocatorException e) {
			throw new DelegateException(e);
		}
	}

	public SchdJobAssociations createFireNowJobAssociation(Long ownerId,Long ownerType,Long schemeType,String action)
			throws ServiceBeanException {
		return schdJobAssociationsService.createFireNowJobAssociation(ownerId,ownerType,schemeType,action);
	}

	public List<SchdJobAssociations> getActiveJobAssosciations()
			throws ServiceBeanException {
		return schdJobAssociationsService.getActiveJobAssosciations();
	}

	public String getJobAssociationParameter(String jobName, String jobGroup,
			String triggerName, String triggerGroup)
			throws ServiceBeanException {
		return schdJobAssociationsService.getJobAssociationParameter(jobName,
				jobGroup, triggerName, triggerGroup);
	}
	
	public String getJobAssociationParameter(String jobName, String jobGroup)
			throws ServiceBeanException {
		return schdJobAssociationsService.getJobAssociationParameter(jobName,
				jobGroup);
	}

}
